#pragma once
#include "DCore.h"
#include "UIManager.h"
struct TreeInf
{	
	enum ITEM_TYPE
	{
		IT_STAGE,
		IT_SCENE,
		IT_CTRL
	};

	void* pTreeItem;
	HTREEITEM parent;
	ITEM_TYPE itemType;
	int stageIndex;
};

class DToolRun :
	public DSingleton <DToolRun>, public DCore
{
public:
	UIManager m_UIManager;
private:
	friend class DSingleton <DToolRun>;
	friend class DCore;
	DToolRun(void);
	virtual ~DToolRun(void);
	TreeInf m_SeletUI;


public:

	void Run()
	{
		DCore::CoreRun();
	}
	bool Init();
	bool Frame();
	bool Render();
	bool Release();

	void MoveSeletUI();
	bool CheckCollision(RECT rect, POINT point);

	inline void SetSeletUI(TreeInf UI) { m_SeletUI = UI; }

	void InsertUIStage(int index, UIStage* pUIStage);
	void InsertUIScene(UIScene* pUScene, UIStage* pUIStage);
	void InsertUIControl(UIControl* pUICtrl, UIStage* pUIStage);
	void InsertUIControl(UIControl* pUICtrl, UIScene* pUIScene);
};
